using System;
using System.Text;
using System.Collections;

using Evolution.Engine.SpatialTrees;
using Evolution.Engine.Managers;
using Evolution.Engine.Objects;
using Evolution.Engine.Utilities;
using Evolution.Engine.Cameras;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Evolution.Engine.GUI;
using System.CodeDom.Compiler;

namespace Evolution.Engine.Test
{
    static class Program
    {
        //static GameEngine GameEngine = null;

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            try
            {
                LogManager.Instance.WriteLine(string.Format("Startup {0}", DateTime.Now));
                GameEngine.Instance.OnInitialize += new Initialize(Instance_OnInitialize);

                GameEngine.Instance.Graphics.MinimumVertexShaderProfile = ShaderProfile.VS_2_0;
                GameEngine.Instance.Graphics.MinimumPixelShaderProfile = ShaderProfile.PS_2_0;

                GameEngine.Instance.Run();
            }
            catch (CompileError ce)
            {
                foreach (CompilerError error in ce.Errors)
                {
                    LogManager.Instance.WriteLine(error.ToString());
                }
            }
            catch (Exception ex)
            {
                LogManager.Instance.WriteLine(ex.ToString());
            }
            LogManager.Instance.WriteLine(string.Format("Stop {0}", DateTime.Now));
        }

        static void Instance_OnInitialize()
        {
            EvolutionGuiSystem.Instance.AddForm(new GUI.TestForm());

            SceneManager.Instance.AddSpatialManager("tempScene", new Scene());
        }
    }
}

